#include "Ze08Ch2o.h"

char Ze08_Ch2o_data[9];


void Ze08_Ch2o_Init(void)
{
    Serial1.begin(9600,SERIAL_8N1,SERIAL1_RX,SERIAL1_TX);

    Serial.println("Ze08_Ch2o_Init success");
}

void Read_Ze08_Ch2o_Data(void)
{
    unsigned short i, j = 0;
    i = Serial1.available();
    if(i != 0)
    {
        while(i--)
        {
            Ze08_Ch2o_data[j] = Serial1.read();
            j++;
        }
        j = 0;

        if(Ze08_Ch2o_data[0] == 0xFF)
        {
            for(int i = 0; i < 9; i++)
            {
                Serial.printf("%x ",Ze08_Ch2o_data[i]);
            }
            Serial.println();
        } 
    }
}